import lessModule from "./index.module.less"
import closeImage from "../../../../../../assets/image/homePage-close.png"
import HomePage_HeaderOperationComponent_LayoutSettingComponent from "../../../headerOperation/component/layoutSetting"
interface homePageModalComponentHeaderNormalComponentInterface {
    name: string
    padding: string
    fontSize?: number
    isLayoutSetting?: boolean
    isBorderBottomHide?: boolean
    change_cancel: Function
}
// 主页-弹窗组件-通用头部组件
const HomePage_ModalComponent_HeaderNormalComponent: React.FC<homePageModalComponentHeaderNormalComponentInterface> = (props) => {
    return (
        <header className={lessModule["homePageModalComponentHeaderNormalComponent"]} style={{ padding: props.padding, fontSize: props.fontSize ?? 16, borderBottom: props.isBorderBottomHide ? "none" : "1px solid rgba(0, 0, 0, 0.15)" }}>
            <span>{props.name}</span>
            {
                props.isLayoutSetting && <HomePage_HeaderOperationComponent_LayoutSettingComponent name="reviewWorkOrderSwitchIdx" isWarningLineHide layoutItemList={["改后", "改前"]} />
            }
            <img className="homePage-handleImage" src={closeImage} onClick={() => props.change_cancel()} />
        </header>
    )
}

export default HomePage_ModalComponent_HeaderNormalComponent